﻿Public Class CollectionsExampleForm

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer

        'For i = 0 To Me.Controls.Count - 1
        '    MessageBox.Show("Control #" & i & " : " & Me.Controls(i).Name)
        'Next

        i = 0
        For Each c As Control In Me.Controls
            MessageBox.Show("Control #" & i & " : " & c.Name)
            i += 1
        Next

    End Sub
End Class
